package com.semidata.trp.monitor.job;

import com.semidata.rtd.core.executor.TaskExecutor;
import com.semidata.rtd.core.http.server.HttpSession;
import com.semidata.rtd.core.job.Job;
import com.semidata.rtd.core.job.ScheduledTask;
import com.semidata.rtd.core.log.Logger;

public class TaskLog extends ScheduledTask<Void, MonitorJobContext> {

    public TaskLog(Job<MonitorJobContext> job, TaskExecutor executor) {
        super(job, executor);

    }

    public Void run() {
        HttpSession session = getJob().getJobContext().getSession();
        
        MonitorRequest request = new MonitorRequest(session);
        getJob().getJobContext().setMonitorRequest(request);
        Logger.log("MONITOR", request.getLogString());
        return null;
    }
    
    @Override
    protected void done(Void result, Throwable cause) {
    }
}
